﻿<%@ page import="hyl.ext.base.TokenFactory,hyl.ext.base.MyToken"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">

<head>
<meta charset="UTF-8">

<meta
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
	name="viewport" />
<!-- 全局变量 函数定义区 见top.jsp -->
<%@ include file="pub/top1.jsp"%>
<title><%=SYSTEMNAME%></title>
<!-- 实例变量 函数定义区 -->
<%
//网页title String JSPTITLE="登录" ;
%>


<link type="text/css" href="<%=basePath%>cssjs/login1/css/style.css"
	rel="stylesheet">
<link type="text/css" href="<%=basePath%>cssjs/layui/css/layui.css"
	rel="stylesheet">

<script src="<%=basePath%>cssjs/layui/layui.js"></script>
<script src="<%=basePath%>cssjs/jquery/zepto.min.js"></script>
<script src="<%=basePath%>cssjs/hyl/core/safe/md5.js"></script>
<style>
body {
	background-image: url("<%=basePath%>cssjs/login1/picture/1.jpg");
	background-repeat: no-repeat;
	/* 防止图片重复 */
	background-size: cover;
	/* 让图片铺满整个屏幕 */
}
</style>
</head>

<body>


	<div id="Tz_Login">
		<h3 id="title" class="">用户登录</h3>
		<form action="" method="post" target="_blank">
			<input type="text" placeholder="用户名" class="txt " id="用户名"
				required="" autocomplete="off"> <input type="password"
				placeholder="密码" class="txt " id="密码" required=""> <input
				type="button" class="but " value="登 录" id="submit">
		</form>
	</div>



</body>

</html>
<script type="module">
	import "<%=basePath%>cssjs/hyl/core/fun.js";
	import "<%=basePath%>cssjs/Mm.js";

	HYL_URLS.URL_DAO_PUBLICKEY = BASEPATH.concat("l/publickey");
	HYL_URLS.URL_DAO_KEY = BASEPATH.concat("l/sm4key");
	HYL_URLS.URL_DAO_LOGIN = BASEPATH.concat("l/login");
	var e能否提交 = false;

	function message(e) {
		layer.msg(e, { icon: 0, anim: 5, time: 800 }, function () {
			// layer.msg('提示框关闭后的回调');
		});
	}
	$(document).ready(function () {
		Mm.f准备(HYLSessionKey,HYL_URLS, () => {
			e能否提交 = true;
		});
		$("#submit").click(function () {
			if (!e能否提交) return;
			let uname = $("#用户名").val(); 
			let upass = $("#密码").val();
			if (HYL登录状态 == "1") {
				window.location = HYL_URLS.URL_MAIN;
				return;
			}
			Mm.f登录(uname, upass,
				data=> {}, (e) => {message(e));
		});
	});


</script>